From 0d3a3e02112928b72f83d6ef83c6d006320c2861 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 21 Nov 2004 09:47:00 +0000 Subject: [PATCH] Try to keep Title class as a value object: remove the setNamespace() method. Make a new object if you want to change it... --- includes/SpecialContributions.php | 2 +- includes/SpecialUpload.php | 2 +- includes/Title.php | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index aa1da78215..875bd25d7c 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -40,7 +40,7 @@ function wfSpecialContributions( $par = '' ) { $wgOut->errorpage( 'notargettitle', 'notargettext' ); return; } - $nt->setNamespace( Namespace::getUser() ); + $nt =& Title::makeTitle( NS_USER, $nt->getDBkey() ); $id = User::idFromName( $nt->getText() ); diff --git a/includes/SpecialUpload.php b/includes/SpecialUpload.php index f4fd321473..1e3d40c76d 100644 --- a/includes/SpecialUpload.php +++ b/includes/SpecialUpload.php @@ -178,7 +178,7 @@ class UploadForm { if( is_null( $nt ) ) { return $this->uploadError( wfMsg( 'illegalfilename', htmlspecialchars( $filtered ) ) ); } - $nt->setNamespace( NS_IMAGE ); + $nt =& Title::makeTitle( NS_IMAGE, $nt->getDBkey() ); $this->mUploadSaveName = $nt->getDBkey(); /** diff --git a/includes/Title.php b/includes/Title.php index b23dd4b2e7..b017959130 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -466,12 +466,6 @@ class Title { * @access public */ function getNamespace() { return $this->mNamespace; } - /** - * Set the namespace index - * @param int $n the namespace index, one of the NS_xxxx constants - * @access public - */ - function setNamespace( $n ) { $this->mNamespace = IntVal( $n ); } /** * Get the interwiki prefix (or null string) * @return string -- 2.20.1